void InsertOrder()
{
using namespace std;
vector<int> p1;
vector<int> p2;
srand((int)time(0));
for (int i = 0; i < 5; i++) {
p1.push_back(rand()%10);
}
for (int i = 0; i < p1.size(); i++) {
if(p2.empty())
{
p2.push_back(p1[i]);
}
else
{
for (int j = 0; j < p2.size(); j++) {
if(p1[i] < p2[j])
{
p2.insert(p2.begin()+j, p1[i]);
break;
}
else
{
if(j == p2.size()-1)
{
p2.push_back(p1[i]);
break;
}
}
}
}
}
for (vector<int>::iterator it = p2.begin(); it != p2.end(); it++) {
std::cout << *it << std::endl;
}
}